<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Class: CertificacaoController</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Class</strong></td>
          <td class="class-name-in-header">CertificacaoController</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../files/app/controllers/certificacao_controller_rb.html">
                app/controllers/certificacao_controller.rb
                </a>
        <br />
            </td>
        </tr>

        <tr class="top-aligned-row">
            <td><strong>Parent:</strong></td>
            <td>
                <a href="ApplicationController.html">
                ApplicationController
               </a>
            </td>
        </tr>
        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">



   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000016">add_certificador</a>&nbsp;&nbsp;
      <a href="#M000013">cancelarCert</a>&nbsp;&nbsp;
      <a href="#M000017">del_cert</a>&nbsp;&nbsp;
      <a href="#M000018">del_certificador</a>&nbsp;&nbsp;
      <a href="#M000019">escalarCertificador</a>&nbsp;&nbsp;
      <a href="#M000011">home</a>&nbsp;&nbsp;
      <a href="#M000009">index</a>&nbsp;&nbsp;
      <a href="#M000010">show</a>&nbsp;&nbsp;
      <a href="#M000015">solicitarAtualizacaoBdCert</a>&nbsp;&nbsp;
      <a href="#M000014">solicitarAtualizacaoServidorCert</a>&nbsp;&nbsp;
      <a href="#M000012">ultimas_req</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">





      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000016" class="method-detail">
        <a name="M000016"></a>

        <div class="method-heading">
          <a href="#M000016" class="method-signature">
          <span class="method-name">add_certificador</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000016-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000016-source">
<pre>
    <span class="ruby-comment cmt"># File app/controllers/certificacao_controller.rb, line 80</span>
80:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_certificador</span>
81:     <span class="ruby-ivar">@requisicao</span> = <span class="ruby-constant">Requisicao</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">params</span>[<span class="ruby-identifier">:requisicao</span>][<span class="ruby-identifier">:req_id</span>])
82:     <span class="ruby-identifier">cert_existentes</span> = <span class="ruby-ivar">@requisicao</span>.<span class="ruby-identifier">certificadores</span>.<span class="ruby-identifier">collect</span>
83:     <span class="ruby-ivar">@cert</span> = <span class="ruby-constant">Certificador</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">params</span>[<span class="ruby-identifier">:certificador</span>][<span class="ruby-identifier">:id</span>])
84:     <span class="ruby-identifier">aux</span> = <span class="ruby-keyword kw">nil</span>
85:     <span class="ruby-keyword kw">for</span> <span class="ruby-identifier">i</span> <span class="ruby-keyword kw">in</span> <span class="ruby-identifier">$lista_cert</span> <span class="ruby-comment cmt">#iniciada em requisicoes_controller </span>
86:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">i</span> <span class="ruby-operator">==</span> <span class="ruby-ivar">@cert</span>.<span class="ruby-identifier">id</span>.<span class="ruby-identifier">to_i</span>
87:           <span class="ruby-identifier">aux</span> = <span class="ruby-identifier">i</span>.<span class="ruby-identifier">to_i</span>
88:           <span class="ruby-ivar">@cert</span> = <span class="ruby-keyword kw">nil</span>
89:           <span class="ruby-identifier">flash</span>[<span class="ruby-identifier">:notice</span>] = <span class="ruby-value str">&quot;Certificador ja escalado&quot;</span>
90:       <span class="ruby-keyword kw">end</span>
91:     <span class="ruby-keyword kw">end</span>
92:     <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">aux</span>.<span class="ruby-identifier">nil?</span>
93:       <span class="ruby-identifier">$lista_cert</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@cert</span>.<span class="ruby-identifier">id</span>.<span class="ruby-identifier">to_i</span>
94:     <span class="ruby-keyword kw">end</span>
95:     <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$lista_cert</span>.<span class="ruby-identifier">empty?</span>
96:       <span class="ruby-ivar">@cert</span> = <span class="ruby-constant">Desenvolvedor</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">params</span>[<span class="ruby-identifier">:certificador</span>][<span class="ruby-identifier">:id</span>])
97:       <span class="ruby-identifier">$lista_cert</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@cert</span>.<span class="ruby-identifier">id</span>.<span class="ruby-identifier">to_i</span>
98:     <span class="ruby-keyword kw">end</span>      
99:   <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000013" class="method-detail">
        <a name="M000013"></a>

        <div class="method-heading">
          <a href="#M000013" class="method-signature">
          <span class="method-name">cancelarCert</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000013-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000013-source">
<pre>
    <span class="ruby-comment cmt"># File app/controllers/certificacao_controller.rb, line 34</span>
34:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cancelarCert</span>
35:     <span class="ruby-identifier">historico</span> = <span class="ruby-constant">Historico</span>.<span class="ruby-identifier">new</span>
36:     <span class="ruby-identifier">historico</span>.<span class="ruby-identifier">attributes</span> = <span class="ruby-identifier">params</span>[<span class="ruby-identifier">:historico</span>]
37:     <span class="ruby-identifier">historico</span>.<span class="ruby-identifier">usuario_id</span> = <span class="ruby-constant">Goldberg</span>.<span class="ruby-identifier">user</span>.<span class="ruby-identifier">id</span>
38:     <span class="ruby-ivar">@requisicao</span> = <span class="ruby-constant">Requisicao</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">historico</span>.<span class="ruby-identifier">requisicao_id</span>)
39:     <span class="ruby-ivar">@requisicao</span>.<span class="ruby-identifier">cancelarCert!</span>
40:     <span class="ruby-identifier">historico</span>.<span class="ruby-identifier">estado</span> = <span class="ruby-ivar">@requisicao</span>.<span class="ruby-identifier">estado</span>
41:     <span class="ruby-ivar">@requisicao</span>.<span class="ruby-identifier">historicos</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">historico</span>
42:     <span class="ruby-identifier">flash</span>[<span class="ruby-identifier">:notice</span>] = <span class="ruby-value str">'Operação realizada com sucesso.'</span>        
43:     <span class="ruby-identifier">redirect_to</span> <span class="ruby-identifier">:action</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'home'</span>
44:   <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000017" class="method-detail">
        <a name="M000017"></a>

        <div class="method-heading">
          <a href="#M000017" class="method-signature">
          <span class="method-name">del_cert</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000017-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000017-source">
<pre>
     <span class="ruby-comment cmt"># File app/controllers/certificacao_controller.rb, line 101</span>
101:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">del_cert</span>
102:     <span class="ruby-ivar">@requisicao</span> = <span class="ruby-constant">Requisicao</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">params</span>[<span class="ruby-identifier">:requisicao</span>])
103:     <span class="ruby-ivar">@requisicao</span>.<span class="ruby-identifier">certificadores</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-constant">Certificador</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">params</span>[<span class="ruby-identifier">:id</span>]))
104:     <span class="ruby-identifier">render</span> <span class="ruby-identifier">:update</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">page</span><span class="ruby-operator">|</span>
105:       <span class="ruby-identifier">page</span>.<span class="ruby-identifier">remove</span>(<span class="ruby-identifier">params</span>[<span class="ruby-identifier">:id</span>])
106:     <span class="ruby-keyword kw">end</span>
107:   <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000018" class="method-detail">
        <a name="M000018"></a>

        <div class="method-heading">
          <a href="#M000018" class="method-signature">
          <span class="method-name">del_certificador</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000018-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000018-source">
<pre>
     <span class="ruby-comment cmt"># File app/controllers/certificacao_controller.rb, line 109</span>
109:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">del_certificador</span>
110:     <span class="ruby-identifier">aux</span> = []
111:     <span class="ruby-keyword kw">for</span> <span class="ruby-identifier">i</span> <span class="ruby-keyword kw">in</span> <span class="ruby-identifier">$lista_cert</span>
112:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">i</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">params</span>[<span class="ruby-identifier">:id</span>].<span class="ruby-identifier">to_i</span>
113:         <span class="ruby-identifier">aux</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">i</span>.<span class="ruby-identifier">to_i</span>
114:       <span class="ruby-keyword kw">end</span>
115:     <span class="ruby-keyword kw">end</span>
116:     <span class="ruby-identifier">$lista_cert</span> = <span class="ruby-identifier">aux</span>
117:     <span class="ruby-ivar">@cert</span> = <span class="ruby-constant">Certificador</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">params</span>[<span class="ruby-identifier">:id</span>])
118:     <span class="ruby-comment cmt">#      @requisicao = Requisicao.find(params[:req_id])</span>
119:     <span class="ruby-comment cmt">#      @requisicao.desenvolvedores.delete(@desenv)</span>
120:     <span class="ruby-identifier">render</span> <span class="ruby-identifier">:update</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">page</span><span class="ruby-operator">|</span>
121:       <span class="ruby-identifier">page</span>.<span class="ruby-identifier">remove</span>(<span class="ruby-ivar">@cert</span>.<span class="ruby-identifier">dom_id</span>)
122:     <span class="ruby-keyword kw">end</span>
123:   <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000019" class="method-detail">
        <a name="M000019"></a>

        <div class="method-heading">
          <a href="#M000019" class="method-signature">
          <span class="method-name">escalarCertificador</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000019-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000019-source">
<pre>
     <span class="ruby-comment cmt"># File app/controllers/certificacao_controller.rb, line 125</span>
125:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">escalarCertificador</span>
126:     <span class="ruby-identifier">msg</span> = <span class="ruby-value str">''</span>
127:     <span class="ruby-ivar">@requisicao</span> = <span class="ruby-constant">Requisicao</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">params</span>[<span class="ruby-identifier">:id</span>])
128:     <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">$lista_cert</span>.<span class="ruby-identifier">empty?</span>
129:       <span class="ruby-keyword kw">for</span> <span class="ruby-identifier">i</span> <span class="ruby-keyword kw">in</span> <span class="ruby-identifier">$lista_cert</span>
130:         <span class="ruby-ivar">@requisicao</span>.<span class="ruby-identifier">certificadores</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">Certificador</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">i</span>)
131:       <span class="ruby-keyword kw">end</span>
132:     <span class="ruby-keyword kw">for</span> <span class="ruby-identifier">certs</span> <span class="ruby-keyword kw">in</span> <span class="ruby-ivar">@requisicao</span>.<span class="ruby-identifier">certificadores</span> 
133:       <span class="ruby-identifier">msg</span> = <span class="ruby-identifier">msg</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">certs</span>.<span class="ruby-identifier">fullname</span> <span class="ruby-operator">+</span> <span class="ruby-value str">'; '</span>
134:     <span class="ruby-keyword kw">end</span>
135:     <span class="ruby-ivar">@requisicao</span>.<span class="ruby-identifier">escalarCertificador!</span>  
136:     <span class="ruby-identifier">historico</span> = <span class="ruby-constant">Historico</span>.<span class="ruby-identifier">new</span>
137:     <span class="ruby-identifier">historico</span>.<span class="ruby-identifier">observacao</span> = <span class="ruby-value str">'Certificação alocada para: '</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">msg</span>
138:     <span class="ruby-identifier">historico</span>.<span class="ruby-identifier">usuario_id</span> = <span class="ruby-constant">Goldberg</span>.<span class="ruby-identifier">user</span>.<span class="ruby-identifier">id</span>
139:     <span class="ruby-identifier">historico</span>.<span class="ruby-identifier">estado</span> = <span class="ruby-ivar">@requisicao</span>.<span class="ruby-identifier">estado</span>
140:     <span class="ruby-ivar">@requisicao</span>.<span class="ruby-identifier">historicos</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">historico</span>       
141:     <span class="ruby-identifier">flash</span>[<span class="ruby-identifier">:notice</span>] = <span class="ruby-value str">'Operação realizada com sucesso'</span>
142:     <span class="ruby-identifier">redirect_to</span> <span class="ruby-identifier">:action</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;home&quot;</span>
143:   <span class="ruby-keyword kw">else</span>
144:     <span class="ruby-identifier">flash</span>[<span class="ruby-identifier">:notice</span>] = <span class="ruby-value str">'Adicione pelomenos um desenvolvedor'</span>
145:     <span class="ruby-identifier">redirect_to</span> <span class="ruby-identifier">:controller</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;requisicoes&quot;</span>, <span class="ruby-identifier">:action</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;escalarDesenvolvedor_tela&quot;</span>, <span class="ruby-identifier">:id</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@requisicao</span>
146:   <span class="ruby-keyword kw">end</span>   
147:   <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000011" class="method-detail">
        <a name="M000011"></a>

        <div class="method-heading">
          <a href="#M000011" class="method-signature">
          <span class="method-name">home</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000011-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000011-source">
<pre>
    <span class="ruby-comment cmt"># File app/controllers/certificacao_controller.rb, line 20</span>
20:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">home</span>
21:     <span class="ruby-ivar">@requisicao_pages</span>, <span class="ruby-ivar">@requisicoes</span> = <span class="ruby-identifier">paginate</span>(<span class="ruby-identifier">:requisicoes</span>, <span class="ruby-identifier">:per_page</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">10</span>, 
22:                                       <span class="ruby-identifier">:conditions</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;estado = 'aguardandoCertificacao' or
23:                                       estado = 'atualizacaoBdCanceladaCert' or
24:                                       estado = 'atualizacaoServidorCanceladaCert' or
25:                                       estado = 'atualizacaoServidorConcluidaCert' or
26:                                       estado = 'atualizacaoBdConcluidaCert'
27:                                       &quot;</span>)
28:   <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000009" class="method-detail">
        <a name="M000009"></a>

        <div class="method-heading">
          <a href="#M000009" class="method-signature">
          <span class="method-name">index</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000009-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000009-source">
<pre>
   <span class="ruby-comment cmt"># File app/controllers/certificacao_controller.rb, line 2</span>
2:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">index</span>
3:     <span class="ruby-identifier">home</span>
4:     <span class="ruby-identifier">render</span> <span class="ruby-identifier">:action</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'home'</span>
5:   <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000010" class="method-detail">
        <a name="M000010"></a>

        <div class="method-heading">
          <a href="#M000010" class="method-signature">
          <span class="method-name">show</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000010-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000010-source">
<pre>
    <span class="ruby-comment cmt"># File app/controllers/certificacao_controller.rb, line 10</span>
10:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">show</span>
11:     <span class="ruby-ivar">@requisicao</span> = <span class="ruby-constant">Requisicao</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">params</span>[<span class="ruby-identifier">:id</span>])
12:     <span class="ruby-ivar">@events</span> = <span class="ruby-identifier">filtra_eventos</span>(<span class="ruby-ivar">@requisicao</span>.<span class="ruby-identifier">next_events_for_current_state</span>)
13:         <span class="ruby-ivar">@certificadores</span> = <span class="ruby-constant">Certificador</span>.<span class="ruby-identifier">find_by_sql</span>(<span class="ruby-node">&quot;select t.id, t.name
14:                                 from goldberg_users t, certificadores_requisicoes dr, requisicoes r
15:                                 where t.id = dr.certificador_id
16:                                 and dr.requisicao_id = r.id
17:                                 and r.id = #{params[:id]}&quot;</span>)
18:   <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000015" class="method-detail">
        <a name="M000015"></a>

        <div class="method-heading">
          <a href="#M000015" class="method-signature">
          <span class="method-name">solicitarAtualizacaoBdCert</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Essa ação pode ser executada tanto pelo certificador quanto pelo gerente
de certificação
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000015-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000015-source">
<pre>
    <span class="ruby-comment cmt"># File app/controllers/certificacao_controller.rb, line 63</span>
63:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">solicitarAtualizacaoBdCert</span>
64:     <span class="ruby-identifier">historico</span> = <span class="ruby-constant">Historico</span>.<span class="ruby-identifier">new</span>
65:     <span class="ruby-identifier">historico</span>.<span class="ruby-identifier">attributes</span> = <span class="ruby-identifier">params</span>[<span class="ruby-identifier">:historico</span>]
66:     <span class="ruby-identifier">historico</span>.<span class="ruby-identifier">usuario_id</span> = <span class="ruby-constant">Goldberg</span>.<span class="ruby-identifier">user</span>.<span class="ruby-identifier">id</span>
67:     <span class="ruby-ivar">@requisicao</span> = <span class="ruby-constant">Requisicao</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">historico</span>.<span class="ruby-identifier">requisicao_id</span>)
68:     <span class="ruby-ivar">@requisicao</span>.<span class="ruby-identifier">solicitarAtualizacaoBdCert!</span>
69:     <span class="ruby-identifier">historico</span>.<span class="ruby-identifier">estado</span> = <span class="ruby-ivar">@requisicao</span>.<span class="ruby-identifier">estado</span>
70:     <span class="ruby-ivar">@requisicao</span>.<span class="ruby-identifier">historicos</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">historico</span>
71:     <span class="ruby-keyword kw">case</span> <span class="ruby-constant">Goldberg</span>.<span class="ruby-identifier">user</span>.<span class="ruby-identifier">role_id</span>
72:       <span class="ruby-keyword kw">when</span> <span class="ruby-value">10</span> <span class="ruby-keyword kw">then</span>
73:         <span class="ruby-identifier">redirect_to</span> <span class="ruby-identifier">:controller</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'certificador'</span>, <span class="ruby-identifier">:action</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'index'</span>
74:       <span class="ruby-keyword kw">when</span> <span class="ruby-value">13</span> <span class="ruby-keyword kw">then</span>
75:         <span class="ruby-identifier">redirect_to</span> <span class="ruby-identifier">:controller</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'certificacao'</span>, <span class="ruby-identifier">:action</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'index'</span>   
76:     <span class="ruby-keyword kw">end</span>
77:     <span class="ruby-identifier">puts</span> <span class="ruby-constant">Goldberg</span>.<span class="ruby-identifier">user</span>.<span class="ruby-identifier">role_id</span>
78:   <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000014" class="method-detail">
        <a name="M000014"></a>

        <div class="method-heading">
          <a href="#M000014" class="method-signature">
          <span class="method-name">solicitarAtualizacaoServidorCert</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000014-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000014-source">
<pre>
    <span class="ruby-comment cmt"># File app/controllers/certificacao_controller.rb, line 46</span>
46:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">solicitarAtualizacaoServidorCert</span>
47:     <span class="ruby-identifier">historico</span> = <span class="ruby-constant">Historico</span>.<span class="ruby-identifier">new</span>
48:     <span class="ruby-identifier">historico</span>.<span class="ruby-identifier">attributes</span> = <span class="ruby-identifier">params</span>[<span class="ruby-identifier">:historico</span>]
49:     <span class="ruby-identifier">historico</span>.<span class="ruby-identifier">usuario_id</span> = <span class="ruby-constant">Goldberg</span>.<span class="ruby-identifier">user</span>.<span class="ruby-identifier">id</span>
50:     <span class="ruby-ivar">@requisicao</span> = <span class="ruby-constant">Requisicao</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">historico</span>.<span class="ruby-identifier">requisicao_id</span>)
51:     <span class="ruby-ivar">@requisicao</span>.<span class="ruby-identifier">solicitarAtualizacaoServidorCert!</span>
52:     <span class="ruby-identifier">historico</span>.<span class="ruby-identifier">estado</span> = <span class="ruby-ivar">@requisicao</span>.<span class="ruby-identifier">estado</span>
53:     <span class="ruby-ivar">@requisicao</span>.<span class="ruby-identifier">historicos</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">historico</span>
54:     <span class="ruby-keyword kw">case</span> <span class="ruby-constant">Goldberg</span>.<span class="ruby-identifier">user</span>.<span class="ruby-identifier">role_id</span>
55:       <span class="ruby-keyword kw">when</span> <span class="ruby-value">10</span> <span class="ruby-keyword kw">then</span>
56:         <span class="ruby-identifier">redirect_to</span> <span class="ruby-identifier">:controller</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'certificador'</span>, <span class="ruby-identifier">:action</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'index'</span>
57:       <span class="ruby-keyword kw">when</span> <span class="ruby-value">13</span> <span class="ruby-keyword kw">then</span>
58:         <span class="ruby-identifier">redirect_to</span> <span class="ruby-identifier">:controller</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'certificacao'</span>, <span class="ruby-identifier">:action</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'index'</span>   
59:     <span class="ruby-keyword kw">end</span>
60:   <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000012" class="method-detail">
        <a name="M000012"></a>

        <div class="method-heading">
          <a href="#M000012" class="method-signature">
          <span class="method-name">ultimas_req</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000012-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000012-source">
<pre>
    <span class="ruby-comment cmt"># File app/controllers/certificacao_controller.rb, line 30</span>
30:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">ultimas_req</span>
31:     <span class="ruby-ivar">@requisicao_pages</span>, <span class="ruby-ivar">@requisicoes</span> = <span class="ruby-identifier">paginate</span>(<span class="ruby-identifier">:requisicoes</span>, <span class="ruby-identifier">:per_page</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">10</span>, <span class="ruby-identifier">:conditions</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;estado = 'emCert' or  estado = 'escaladaCert'&quot;</span>)     
32:   <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>